﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using QuanLyThuoc.DAL;
namespace QuanLyThuoc.BUS
{
  public  class BenhNhanBUS
    {
      private static readonly BenhNhanDAL bn = new BenhNhanDAL();
      public static DataTable SelectAll_BenhNhan()
      {
          return bn.SelectAll_BenhNhan();
      }
      public static DataTable SelectID_BenhNhanMAX()
      {
          return bn.SelectID_BenhNhanMAX();
      }
      public static DataTable LayIDBenhNhanTheoTen()
      {
          string sql = @"select TenBN,IDBN,NamSinh,Gioi,DiaChi,SoDT from tbBenhNhan order by TenBN";
          return bn.GetDataTable(sql);
      }
      public static DataTable Search_BenhNhanByDK(string keyword)
      {
          return bn.Search_BenhNhanByDK(keyword);
      }
      public static DataTable SelectID_BenhNhan(int ID)
      {
          return bn.SelectID_BenhNhan(ID);
      }
      public static DataTable Search(int MaBN, string TenBN, string Gioi, string NamSinh, string DiaChi, string DienThoai)
      {
          return bn.Search(MaBN, TenBN, Gioi, NamSinh, DiaChi, DienThoai);
      }
      public static int InsertBenhNhan(string TenBN, string Gioi, string NamSinh, string DiaChi, string DienThoai)
      {
          return bn.InsertBenhNhan(TenBN, Gioi, NamSinh, DiaChi, DienThoai);
      }
      public static int UpdateBenhNhan(int MaBN, string TenBN, string Gioi, string NamSinh, string DiaChi, string DienThoai)
      {
          return bn.UpdateBenhNhan(MaBN, TenBN, Gioi, NamSinh, DiaChi, DienThoai);
      }
      public static int DeleteBenhNhan(int MaBN)
      {
          return bn.DeleteBenhNhan(MaBN);
      }
    }
}
